package ${packages};
${importService}
import com.kingbook.core.annotations.ContainProperties;
import lombok.extern.slf4j.Slf4j;
import com.kingbook.core.result.JSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Author ${author}
 * @Date ${time}
 * @Version ${version}
 */
@Slf4j
@RestController
@RequestMapping("${javaBeanName}")
public class ${javaBeanClass}Rest {

    @Autowired
    ${javaBeanClass}Service ${javaBeanName}Service;

    @PutMapping${notNullCheck}
    public JSONResult save(@RequestBody Map<String, Object> param) {
        return ${javaBeanName}Service.save(param);
    }
    ${pkCondition}
    @PostMapping("query")
    public JSONResult query(@RequestBody Map<String, Object> param) {
        return ${javaBeanName}Service.query(param);
    }

    @PostMapping("pages")
    @ContainProperties({"pageNo","pageSize"})
    public JSONResult queryForPages(@RequestBody Map<String, Object> param) {
        return ${javaBeanName}Service.queryForPages(param);
    }

}
